package com.ruoyi.matrix.util


data class Tunnel(val localIp: String = "localhost",
                  val localPort: Int = 33000,               // 本机监听端口
                  val tunnelIp: String = "",                // 隧道机器的ip
                  val tunnelPort: Int = 22,
                  val tunnelUsername: String = "root",
                  val tunnelPassword: String = "",
                  val targetIp: String = "",                // 目标ip
                  val targetPort: Int = 80,                 // 目标端口
                  val remark: String = "",
)
data class TunnelConf(val provider: String,
                      val tunnels: List<Tunnel>,
                      val cluster: String,
                      val remark: String,
)

object ProxySessionType {
    const val short = "short"       // 短会话，短效ip
    const val long = "long"         // 长会话，长效ip
}

object ProxyType {
    const val direct = "direct"     // 直连代理
    const val tunnel = "tunnel"     // 隧道代理；需要通过本地的ssh隧道转发到代理服务器
}

data class Proxy(
    val protocol: String,
    val ip: String,
    val port: Long,
    val username: String? = null,
    val password: String? = null,
    val remark: String? = "",
    val proxyId: Long = 0,
    val provider: String = "pool",
    val proxyType: String = ProxyType.direct,
    val tunnels: List<Tunnel> = listOf(),      // 隧道列表，只有隧道类型的ip才有
)

data class ProxyGeo(
    val ip: String = "",
    val country: String = "",
    val province: String = "",
    val city: String = "",
    val isp: String = ""
)